package com.smile.controller;

import com.smile.commons.page.R;
import com.smile.model.request.GetAirportDetailInfoRequest;
import com.smile.service.AirportService;
import com.smile.service.FlightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

@RestController
@RequestMapping("/flight")
public class FlightController {

    @Autowired
    private FlightService flightService;

    @Value("${spring.redis.host}")
    private String redisHost;


//    @PostMapping("/getAirportDetailInfo")
//    public R getAirportDetailInfo(@RequestBody GetAirportDetailInfoRequest getAirportDetailInfoRequest) {
//        return R.ok();
//    }

    /**
     * 飞行数据接口
     * @param getAirportDetailInfoRequest
     * @return
     * @throws IOException
     */
    @PostMapping("/getFlightData")
    public R<Map> getAirportDetailInfo(@RequestBody GetAirportDetailInfoRequest getAirportDetailInfoRequest) throws IOException {
        Map<String,Object> map = flightService.Info(0L);
        return R.ok(map);
    }
}
